<?php

class Account_Model extends CI_Model
{
    function getUser($user_id)
    {
        $this->db->from('users');
        $this->db->where('id', $user_id);
        $this->db->where('active', 1);
        $this->db->select("*");
        $query = $this->db->get();
        $rs = array();
        if ($query->num_rows() > 0)
        {
            $rs = $query->row();
        }
        return $rs;
    }
    function updateName($user_id, $first_name = null, $last_name = null)
    {
        $data = array();
        if ($first_name != null) $data['first_name'] = $first_name;
        if ($last_name != null) $data['last_name'] = $last_name;
        $this->db->where('id', $user_id);
        $this->db->update('users', $data);
    }
    
    function updatePlayer($option=null, $user_id)
    {    
        $this->db->where('user_id', $user_id);
        $this->db->update('player', $option);    
    }
    
    function updatePassword($user_id, $password)
    {
        	
	
    }
}
